import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
/*引入css框架*/
import WindiCSS from 'vite-plugin-windicss'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),WindiCSS()],

  /*与api配合解决跨域问题*/
  server:{
    proxy:{
      '/api':{
        target:'http://127.0.0.1:5000/',
        changeOrigin:true,
        rewrite:path=>path.replace(/^\/api/,'')
       /* pathRewrite: {
          '^/api': ''
          // 通过 pathRewrite 重写地址，将前缀 ^/server 转为 /
        }*/
      }
    }
  }
})

